#ifndef _STATEMENT_H
#define _STATEMENT_H
#include <stdint.h>
#include "InputBuffer.h"
#include "Table.h"
//元命令的结果。
typedef enum {
  META_COMMAND_SUCCESS,
  META_COMMAND_UNRECOGNIZED_COMMAND
} MetaCommandResult;

// “准备语句”的结果。
typedef enum { 
  PREPARE_SUCCESS,
  PREPARE_NEGATIVE_ID,
  PREPARE_STRING_TOO_LONG,
  PREPARE_SYNTAX_ERROR,
  PREPARE_UNRECOGNIZED_STATEMENT,
  } PrepareResult,PrepareResult_t;

//语句的类型。
typedef enum { STATEMENT_INSERT, STATEMENT_SELECT } StatementType;

typedef struct {
  StatementType type;
  Row row_to_insert;  // only used by insert statement
} Statement;

//这个函数用于处理元命令。
MetaCommandResult do_meta_command(InputBuffer* input_buffer, Table *table);
// MetaCommandResult do_meta_command(InputBuffer* input_buffer, Table* table) ;
//这个函数用于准备语句。
PrepareResult prepare_insert(InputBuffer* input_buffer, Statement* statement);
PrepareResult prepare_statement(InputBuffer* input_buffer,Statement* statement);


//这个函数用于执行语句。
ExecuteResult execute_statement(Statement* statement,Table *table);

#endif